(defpackage :sandbox
  (:use :cl)
  (:export :sandbox-view
           :floaters))

(in-package :sandbox)

(defclass sandbox-view (tv:tree-view)
  ((spaced :initform nil :accessor spaced)
   (floaters :initform nil :accessor floaters)))

(defmethod space-tree ((diagram sandbox-view))
  (unless (spaced diagram)
    (call-next-method)))

(defmethod gwee:draw-view ((view sandbox-view))
  (when (d:root view)
    (d:funcall-on-tree (lambda (x) (d:draw-node x view)) (d:root view)))
  (dolist (f (floaters view))
    (d:funcall-on-tree (lambda (x) (d:draw-node x view)) f))
  ;; (call-next-method)
  )
